﻿using AutoMapper;
using WisDom.SmartTMS.Dto;
using WisDom.SmartTMS.Dtos;
using WisDom.SmartTMS.Entities;

namespace WisDom.SmartTMS
{
    public class SmartTMSApplicationAutoMapperProfile : Profile
    {
        public SmartTMSApplicationAutoMapperProfile()
        {
            /* You can configure your AutoMapper mapping configuration here.
             * Alternatively, you can split your mapping configurations
             * into multiple profile classes for a better organization. */
            //构造函数中创建映射关系
            CreateMap<TodoItemDto, TodoItem>();
            CreateMap<Department,DepartmentDto>();
            CreateMap<DepartmentDto, Department>();
            CreateMap<UserDto, Users>();
            CreateMap<Users, UserDto>();
            CreateMap<MenuDto,Menu>();
            CreateMap<Menu,MenuDto>();

            CreateMap<Shipper, ShipperDto>();
            CreateMap<ShipperDto, Shipper>();

            CreateMap<Vehicle, VehicleDto>();
            CreateMap<VehicleDto, Vehicle>();
            CreateMap<Line, LineDto>();
            CreateMap<LineDto, Line>();

            CreateMap<ShipperAuditCreateDto,Shipper>();
            CreateMap<Shipper,ShipperAuditCreateDto>();

            CreateMap<AuditDto,BusinessAudit>();
            CreateMap<BusinessAudit,AuditDto>();

            CreateMap<ShipperAuditLogsDto,BusinessAuditLogs>();
            CreateMap<BusinessAuditLogs, ShipperAuditLogsDto>();

            CreateMap<Contract_Carriage,TMSContractCarrierDto>();
            CreateMap<TMSContractCarrierDto, Contract_Carriage> ();
        }
    }
}
